package com.cjb.base.service.impl;

import com.cjb.base.dao.OrginazationDao;
import com.cjb.base.domain.Orginazation;
import com.cjb.base.service.OrginazationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class OrginazationServiceImpl implements OrginazationService {

    @Autowired
    private OrginazationDao orginazationDao;

    @Override
    public List<Orginazation> getByPid(String pid) {
       return orginazationDao.findByPId(pid);
    }

    @Override
    public List<Orginazation> treeData() {
        Iterable<Orginazation> all = orginazationDao.findAll();
        List<Orginazation> list=new ArrayList<Orginazation>();
        for (Orginazation orginazation:all){
            list.add(orginazation);
        }
        return list;
    }
}
